iptables转发脚本支持双栈/tcp和udp

2024-12-31
537次阅读
没有评论

在IPv4转发的基础上增加对于IPv6转发的支持。

支持tcp和udp。

自用版本iptables双栈转发。

在debian11上测试通过,但无法实现双栈互转,只能v4 to v4、v6 to v6。

有人说可以使用nftables进行转发,但我懒得搞了。

使用方法:

curl -sS -O https://raw.githubusercontent.com/Feelym/iptables-manager/main/iptables-manager.sh && chmod +x iptables-manager.sh && ./iptables-manager.sh

当脚本运行时候出现下面错误:

sysctl: cannot stat /proc/sys/net/netfilter/nf_conntrack_max: No such file or directory
sysctl: cannot stat /proc/sys/net/netfilter/nf_conntrack_tcp_timeout_established: No such file or directory
sysctl: cannot stat /proc/sys/net/netfilter/nf_conntrack_tcp_timeout_time_wait: No such file or directory
sysctl: cannot stat /proc/sys/net/netfilter/nf_conntrack_tcp_timeout_close_wait: No such file or directory
sysctl: cannot stat /proc/sys/net/netfilter/nf_conntrack_tcp_timeout_fin_wait: No such file or directory

解决方法:

sudo modprobe nf_conntrack

正文结束
自由书生
版权声明:本站原创文章,由 自由书生 于2024-12-31发表,共计779字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)
验证码